<?php

if($_POST['pwd'] != $_POST['repwd']){
	echo '<script>alert("两次密码不一致");window.location.href="register.php"</script>';
	die;
}

var_dump($_POST);

include_once('function.php');
$config = include_once('config.php');

$aa['uname'] = $_POST['zhanghao'];
$aa['pwd'] = md5($_POST['pwd']);

$res = add($config,'user',$aa);

if($res>0){
	echo '<script>alert("注册成功");window.location.href="register.php"</script>';
}else{
	echo '<script>alert("注册失败");window.location.href="register.php"</script>';
}
